package com.stylefeng.guns.gateway.common;

public class CurrentUser {
    /** 线程绑定的储存空间 InheritableThreadLocal 线程切换时保存数据 **/
    private static final InheritableThreadLocal<String> threadLocal = new InheritableThreadLocal<>();

    public static void saveUserId(String userId){
        threadLocal.set(userId);
    }

    public static String getCurrentUser(){
        return threadLocal.get();
    }


}
